package com.guigu.www.luolujin.Conteoller;

import com.guigu.www.luolujin.Service.LljMindTestService;
import com.guigu.www.pojo.MindTest;
import com.guigu.www.pojo.PageVo;
import com.guigu.www.pojo.Rubric;
import com.guigu.www.pojo.UserAnswer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 作者 罗露金
 */
@RestController
@RequestMapping("/LljMindTestServlet")
public class LljMindTestServlet {
    @Autowired
    LljMindTestService service;
    @GetMapping()
    public PageVo<MindTest> PageMindTest(Integer pageNum, Integer pageSize, String mindTestName) {
        return service.PageMindTest(pageNum, pageSize, mindTestName);
    }
    @PostMapping("/add")
    public void insertUserAnswer(@RequestBody List<UserAnswer> UserAnswer, String memId) {
        service.insertUserAnswer(memId,UserAnswer);
    }
    @GetMapping("/selectRubric")
    public List<Rubric> selectRubric(Integer rubType) {
        return service.selectRubric(rubType);
    }
    @PostMapping()
    public void insertMindTest(String mindTestName, Integer memId) { service.insertMindTest(mindTestName, memId);}
}
